package com.example.spring_forum.exception;

import com.example.spring_forum.common.AppResult;

/**
 * 全局异常类
 */
public class ApplicationException extends RuntimeException{
   //描述具体的异常信息
    private AppResult errorResult;

    public AppResult getErrorResult() {
        return errorResult;
    }

    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult= errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause,AppResult errorResult) {
        super(cause);

    }
}
